<div class="modal fade" id="update-location-modal" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title"><i class="fa fa-edit"></i> Update Location</h4>
			</div>
			<form action="<?php echo base_url(); ?>control-settings/update-location" method="post" onsubmit="return isBlank()" name="form_change_password">
				<div class="modal-body">
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon"><i class="fa fa-edit"></i></span>
							<input name="location" type="text" class="form-control" placeholder="Location Name" required="required">

						</div>
						<p class="help-block" id="error_location"></p>
					</div>

				</div>
				<div class="modal-footer clearfix">

					<button type="button" class="btn btn-danger" data-dismiss="modal">
						<i class="fa fa-times"></i> Discard
					</button>

					<button type="submit" class="btn btn-primary pull-left">
						<i class="fa fa-edit"></i> Save
					</button>
				</div>
			</form>
		</div><!-- /.modal-content -->
	</div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script>
			$(document).ready(function(){
				  $('.edit_location').click(function () {
				    var answerid = $(this).prop('id');
				    $.ajax({
				    type: "POST",                                      
				      url: '<?php echo base_url()?>control-settings/edit-location',                  //the script to call to get data          
				      data: "location_id="+answerid,                        //you can insert url argumnets here to pass to api.php
				                                       //for example "id=5&parent=6"
				      //dataType: 'json',                //data format      
				      success: function(data)          //on recieve of reply
				      {
				      	alert(data);
				      	
				        //--------------------------------------------------------------------
				        // 3) Update html content
				        //--------------------------------------------------------------------
				        //$('#output').html("<b>id: </b>"+id+"<b> name: </b>"+vname); //Set output element html
				        //recommend reading up on jquery selectors they are awesome 
				        // http://api.jquery.com/category/selectors/
				      } 
				    });
				});
			});
		</script>